<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<script>
function fnUpload(){
	var filePath = document.getElementById("bulk_users").value.toUpperCase();	
	if((filePath.length - filePath.indexOf(".XLS"))==4 ){		
		window.document.userForm.action = '/uploadUserFile.do';
		window.document.userForm.submit();
	}
	else{
		alert("Only Micorsoft Excel file can be uploaded");
		return;
	}
}
</script>
<html:form action="/uploadUserFile" enctype="multipart/form-data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
    		<td>
    			<table width="100%" border="0" cellspacing="0" cellpadding="0">
  					<tr>
  						<jsp:include page="userActionTab.jsp"/>	
  					</tr>
				</table>
			</td>
  		</tr>
  		<tr>
    		<td class="formbg" valign="top">
    			<table width="100%" border="0" cellspacing="0" cellpadding="0">
  					<tr>
    					<td>
    						<table width="100%" border="0" cellspacing="4" cellpadding="0">
    							<tr>
									<td>&nbsp;</td>	
									<td>&nbsp;</td>
									<td>&nbsp;</td>
									<td>&nbsp;</td>
									<td>&nbsp;</td>
								</tr>
  								<tr>
    								<td colspan="6"><jsp:include page="showErrorMessage.jsp"/></td>
  								</tr>
								<tr>
									<td>&nbsp;</td>
									<td class="formText">File Name</td>
									<td valign="middle"><html:file property="bulk_users" styleId ="bulk_users" styleClass="formfile"/></td>
									<td valign="middle"><a href="/downloadTemplateUser.do"><img src="images/download_template.jpg" alt="Download Template"/></a></td>
								</tr>
								<tr>
									<td height="25" colspan="4" valign="top"  >&nbsp;</td>
								</tr>
								<tr>
									<td height="25" colspan="4" align="center" valign="top">
										<input type="button" class="imageButton" value="Upload" onClick="javascript:fnUpload()">
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>				
</html:form>
